package com.asyncscheduled.controller;

import com.yan.service.AsynService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：Yan Guang
 * @date ：Created in 2020/11/20 15:21
 * @description：
 */
@RestController
public class AsyncController {

    @Autowired
    AsynService asynService;

    @RequestMapping("hello")
    public String hello(){
        asynService.hello();//停止三秒,转圈
        //这里的方法加上了异步方法，这样的话会直接先返回OK然后再慢慢加载数据
        return  "OK";
    }
}
